/**
 * Sumpu Inc.
 * Copyright (c) 2011-2012 All Rights Reserved. 
 */
package cn.sumpu.app.guoguojie.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * @author nick
 * @version $Id: DoingShareType.java, v 0.1 2012-8-17 下午03:15:16 nick Exp $
 */
public enum DoingShareType {
    TEXT("text", "普通文本"), PRODUCT("product", "商品"), PICTURE("picture", "图片");

    private String value;
    private String label;

    private DoingShareType(String value, String label) {
        this.value = value;
        this.label = label;
    }

    private static Map<String, String> cache;

    static {
        cache = new HashMap<String, String>();
        cache.put(TEXT.getValue(), TEXT.getLabel());
        cache.put(PRODUCT.getValue(), PRODUCT.getLabel());
        cache.put(PICTURE.getValue(), PICTURE.getLabel());
    }

    public String getValue() {
        return value;
    }

    public String getLabel() {
        return label;
    }

    public static String getLabelByValue(String value) {
        return cache.get(value);
    }
}
